//
//  MLAManageBrandCell.m
//  MagicLampApp
//
//  Created by Zheng on 2018/12/20.
//  Copyright © 2018 zheng.magic.lamp.app. All rights reserved.
//

#import "MLAManageBrandCell.h"
#import "MLAManageBrandModel.h"

@implementation MLAManageBrandCell {
    UILabel *titleLbl;
    UILabel *cateLbl;
}

- (void)setModel:(MLAManageBrandModel *)model {
    _model = model;
    titleLbl.text = _model.name;
    cateLbl.text = [NSString stringWithFormat:@"类别：%@",_model.product_category_name];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
        titleLbl = [[UILabel alloc] init];
        titleLbl.font = CX_GetNormalFont(12);
        titleLbl.textColor = CX_GetColorTitle();
        [self.contentView addSubview:titleLbl];
        [titleLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(15);
            make.centerY.equalTo(self);
        }];
        
        cateLbl = [[UILabel alloc] init];
        cateLbl.font = CX_GetNormalFont(12);
        cateLbl.textColor = CX_GetColorTitle();

        [self.contentView addSubview:cateLbl];
        [cateLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.mas_equalTo(-15);
            make.centerY.equalTo(self);
        }];
        
        /*
         测试数据
        cateLbl.text = @"类别：女装";
        titleLbl.text = @"品牌A";
         */
    }
    return self;
}

@end
